package com.gexiaobao.pigeon.ui.dialog

import android.content.Context
import android.graphics.Bitmap
import android.view.LayoutInflater
import androidx.appcompat.widget.AppCompatImageView
import com.gexiaobao.pigeon.R

/**
 * @Author      : hxw
 * @Date        : 2024/7/10 10:04
 * @Describe    :
 */
class RxDialogBigImage(context: Context?,) : RxDialog(context!!) {

    private lateinit var ivClose: AppCompatImageView
    private lateinit var ivBigImage: AppCompatImageView

    init {
        initView()
    }

    private fun initView() {
        val dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_big_image, null)
        ivClose = dialogView.findViewById(R.id.ivBigImageClose)
        ivBigImage = dialogView.findViewById(R.id.ivBigImage)

        ivBigImage.setOnClickListener {
            dismiss()
        }
        ivClose.setOnClickListener {
            dismiss()
        }

        setContentView(dialogView)
    }

    fun setImage(bitmap: Bitmap) {
        ivBigImage.setImageBitmap(bitmap)
    }
}